/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.latesis.dao.hibernate;

import com.latesis.bean.DetalleServicioBean;
import com.latesis.bean.DetalleServicioBean;
import com.latesis.dao.DetalleServicioDAO;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author acabrera
 */
@Transactional(propagation=Propagation.SUPPORTS)
public class DetalleServicioDAOHibernateImpl extends HibernateDaoSupport implements DetalleServicioDAO{
    public DetalleServicioBean guardar(DetalleServicioBean bean) {
         getHibernateTemplate().saveOrUpdate(bean);
         return bean;
    }

    public void borrar(DetalleServicioBean bean) {
        getHibernateTemplate().delete(bean);
    }

    public DetalleServicioBean buscar(DetalleServicioBean bean) {
        return getHibernateTemplate().get(DetalleServicioBean.class, bean.getId());
    }

    public List<DetalleServicioBean> buscarTodos() {
        return (List<DetalleServicioBean>)getHibernateTemplate().find("from DetalleServicioBean ");
    }
}
